package com.wochao.web.app.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wochao.model.entity.RoomInfo;
import com.wochao.web.app.vo.room.RoomItemVo;
import com.wochao.web.app.vo.room.RoomQueryVo;
import org.apache.ibatis.annotations.Mapper;

import java.math.BigDecimal;

@Mapper
public interface RoomInfoMapper extends BaseMapper<RoomInfo> {

    /**
     * 根据条件分页查询房间列表
     *
     * @param page
     * @param queryVo
     * @return
     */
    IPage<RoomItemVo> pageQueryRoomItem(IPage<RoomItemVo> page, RoomQueryVo queryVo);

    /**
     * 根据公寓id分页查询房间列表
     *
     * @param page
     * @param id
     * @return
     */
    IPage<RoomItemVo> pageItemByApartmentId(IPage<RoomItemVo> page, Long id);

    /**
     * 根据公寓ID查询最小租金
     * @param id
     * @return
     */
    BigDecimal selectMinRentByApartmentId(Long id);
}